/*
 * @Author: your name
 * @Date: 2021-03-13 09:59:45
 * @LastEditTime: 2021-03-20 12:29:52
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \robotc:\Users\hechuan\Desktop\80\wx_admin\src\api\index.js
 */
import request from './request'
async function procedure(functionName, params, url = 'ajax', method = 'post') {
    const response = await request({
        url : `/proxy_app${url}`,
        method,
        data:{
            functionName,
            type:'',
            params
        }
    })
    if (!response) throw new Error('请求失败, 返回结果集为空')
    return response
}
const Ajax = () => {}
Ajax.prototype.as_login = async(params) => {
    return await procedure('as_login', params, '/login')
}
Ajax.prototype.as_swiper_insert = async(params) => {
    return await procedure('as_swiper_insert', params, '/upload_swiper')
}
export default new Ajax()